<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #ul {
            list-style: none;
        }
        #ul li {
            padding: 10px;
            color: #56a5f1;
        }
    </style>
</head>
<body>
    <p>待就业名单</p>
    <ul id="ul">
        <li class="li1">胖祥
            <button onclick="del('li1')">del</button>
        </li>
        <li class="li2">猛男
            <button onclick="del('li2')">del</button>
        </li>
        <li class="li3">大飞哥
            <button onclick="del('li3')">del</button>
        </li>
        <li class="li4">的人
            <button onclick="del('li4')">del</button>
        </li>
        <li class="li5">炫菠萝
            <button onclick="del('li5')">del</button>
        </li>
    </ul>
    <script>
        var ul = document.querySelector('#ul');
        var fly = document.querySelector('.li3');
        var orange = document.querySelector('.li5');
        // 获取style 以及修改style
        orange.style.color = '#e15761';
        console.log(orange.style.color);
        function fn() {
            // 创建一个新的节点 准备替换
            var newOrange = document.createElement('li');
            newOrange.innerHTML = '炫桃子'
            // 删除节点
            ul.removeChild(fly);
            // 替换节点
            ul.replaceChild(newOrange, orange)
        }
        function del(name) {
            var el = document.querySelector('.'+name)
            // 获取id和class 修改id和class
            console.log(el.className);
            el.id = 'li123';
            console.log(el.id);
            ul.removeChild(el);
        }
    </script>
</body>
</html>